<?php
require "Db.php";
$obj = new Db();
$id = $_POST['id'];
$new_name = $_POST['new_name'];

$res = $obj -> upd('exam',$new_name,$id);
if($res){
    echo 1;
}else{
    echo 0;
}